#include <iostream>
#include <string>
class Student {
private:
    int reg_num;
    std::string name;
    double math_score;
    double english_score;
    double computer_score;
public:
    Student(int a, std::string b, double c, double d, double e) {
        std::cout << "构造函数被调用" << std::endl;
        reg_num = a;
        name = b;
        math_score = c;
        english_score = d;
        computer_score = e;
    }
    ~Student() {
        std::cout << "析构函数被调用" << std::endl;
    }
    double sum() {
        return math_score + english_score + computer_score;
    }
    double average() {
        return sum() / 3;
    }
    void print() {
        std::cout << "注册号: " << reg_num << " 姓名: " << name << " 数学成绩: " << math_score << " 英语成绩: " << english_score << " 计算机成绩: " << computer_score << std::endl;
    }
    int get_reg_num() {
        return reg_num;
    }
};
int main() {
    Student students[3] = {
        Student(1, "伍", 60, 70, 80),
        Student(2, "陆", 65, 75, 85),
        Student(3, "柒", 80, 70, 60)
    };
    for (int i = 0; i < 3; i++) {
        students[i].print();
        std::cout << "总成绩:" << students[i].sum() << " 平均成绩:" << students[i].average() << std::endl;
    }
    return 0;
}